package com.cjm.one.webmanager.service.system.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cjm.one.model.base.BaseDeleteMoreVo;
import com.cjm.one.model.system.dto.SysPostDto;
import com.cjm.one.model.system.entity.SysPost;
import com.cjm.one.system.client.SysPostClient;
import com.cjm.one.webmanager.service.system.SysPostService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysPostServiceImpl implements SysPostService {
    @Resource
    private SysPostClient sysPostClient;
    @Override
    public Page<SysPost> list(SysPostDto dto) {
      return  sysPostClient.list(dto).getData();
    }

    @Override
    public Boolean removeById(Long id) {

        return sysPostClient.deleteById(id).getData();
    }

    @Override
    public SysPost getPostById(Long id) {
        return sysPostClient.getById(id).getData();
    }

    @Override
    public Boolean save(SysPost sysPost) {
        return sysPostClient.save(sysPost).getData();
    }

    @Override
    public Boolean updateById(SysPost sysPost) {
        return sysPostClient.update(sysPost).getData();
    }

    @Override
    public BaseDeleteMoreVo removeByIds(List<Long> ids) {
        return sysPostClient.deleteBatchIds(ids).getData();
    }
}
